package com.bss;

import java.util.Date;

import com.bss.ajax.BackupCommand;
import com.bss.framework.FrontController;

public class BackupThread extends Thread {
	
	private static final long SLEEP_TIME = 60 * 60 * 1000;

	public BackupThread() {
	}

	public void run() {		
		while(true) {
			try {
				new BackupCommand().execute(null);
				FrontController.audit("Backup done for "+new Date());
				Thread.sleep(SLEEP_TIME);				
			} catch (Exception e) {
				FrontController.audit("Backup failed for "+new Date());
			}
		}
		
	}

}
